<form class="layui-form layui-box" style='padding:25px 30px 20px 0' action="__SELF__" data-auto="true" method="post">

    <div class="layui-form-item">
        <label class="layui-form-label">商品名称</label>
        <div class="layui-input-block">
            {if $goods }
            <input type="text" readonly="" disabled="" name="goods" value='{$goods.name} {$goods.title}'
                   required="required" title="商品名称" placeholder="商品名称" class="layui-input disabled" readonly>
            {else}
            <input type="text" name="goods" value='{$goods.name}  {$goods.title}' required="required"
                   title="商品名称" placeholder="商品名称" class="layui-input" class="layui-input disabled" readonly>
            {/if}
        </div>
    </div>
        <label class="layui-form-label">选择配方</label>

    <div class="layui-form-item" style="padding-left: 111px;">
        {foreach $peifang as $authorize}
        <div  style="display:inline-block;width:47%;">
            {if in_array($authorize['id'],$goods['peifang_ids'])}
            <label class="think-checkbox">
                <input type="checkbox" checked name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.code}      {$authorize.title}
            </label>
            {else}
            <label class="think-checkbox">
                <input type="checkbox" name="authorize[]" value="{$authorize.id}" lay-ignore> {$authorize.code}      {$authorize.title}
            </label>
            {/if}
        </div>
        {/foreach}
    </div>

    <div class="hr-line-dashed"></div>

    <div class="layui-form-item text-center">
        {if isset($goods.id)}<input type='hidden' value='{$goods.id}' name='id'/>{/if}
        <button class="layui-btn" type='submit'>保存数据</button>
        <a class="layui-btn layui-btn-danger" href="javascript:history.go(-1)">返回</a>

        <!--<button class="layui-btn layui-btn-danger" type='button' data-confirm="确定要取消编辑吗？" data-close>取消编辑</button>-->
    </div>
    <script>window.form.render();</script>
</form>
